package com.zyong.design.pattern.flyweight.case2;

import java.util.Objects;

/**
 * 坦克类型
 * @program: zyong-design-pattern
 * @ClassName: TankType
 * @author: zyong
 * @create: 2024-04-06 10:39
 */
public class TankType {
    private String color;
    private String speed;

    public TankType(String color, String speed) {
        this.color = color;
        this.speed = speed;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        TankType tankType = (TankType) o;

        return color.equals(tankType.color) && speed.equals(tankType.speed);
    }

    @Override
    public int hashCode() {
        return Objects.hash(color, speed);
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getSpeed() {
        return speed;
    }

    public void setSpeed(String speed) {
        this.speed = speed;
    }
}
